package org.bmind.datasword.config.dto;

import java.util.ArrayList;
import java.util.Collection;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.bmind.datasword.utils.EqualsUtil;
import org.bmind.datasword.utils.HashCodeUtil;
import org.bmind.datasword.utils.StorageUtilities;

//@XmlRootElement
public class DParentDatasetContainer extends DObjIdentity{
	static { StorageUtilities.addREngineType(DChildDatasetContainer.class); }
	
	private int fHashCode;
	private Collection<DChildDatasetContainer> dParentDatasetContainer = new ArrayList<DChildDatasetContainer>();

	public DParentDatasetContainer() {super();}

	/**
     * @return the dLLDataset
     */

	public Collection<DChildDatasetContainer> getChildDatasetContainer() {return dParentDatasetContainer;}
	//@XmlElement
    public void setChildDatasetContainer(Collection<DChildDatasetContainer> dParentDatasetContainer) {this.dParentDatasetContainer = dParentDatasetContainer;}

    /* (non-Javadoc)
     * @see org.bmind.datasword.config.dto.DObjCommon#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if ( this == obj ) return true;
 	    if ( !(obj instanceof DParentDatasetContainer) ) return false;
 	   
 	   DParentDatasetContainer dPdc = (DParentDatasetContainer)obj;
 	    
     	return	EqualsUtil.areEqual(this.dParentDatasetContainer, dPdc.dParentDatasetContainer) ;
    }

	/* (non-Javadoc)
     * @see org.bmind.datasword.config.dto.DObjCommon#hashCode()
     */
	@Override
	public int hashCode() {
		
		// this style of lazy initialization is
		// suitable only if the object is immutable
		if (fHashCode == 0) {
		int result = HashCodeUtil.SEED;
			result = HashCodeUtil.hash(result, dParentDatasetContainer);
		
			fHashCode = result;
		}
		return fHashCode;
	}
    
}
